package com.ncepu.clubmanagement.mapper;

import com.ncepu.clubmanagement.pojo.Affair;
import com.ncepu.clubmanagement.pojo.AffairFont;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface AffairsMapper {

    void addCommitteeAffair(Affair affair);


    List<AffairFont> getCommitteeFontAffairByType(Integer type);

    List<AffairFont> getClubFontAffairByType(Integer type);


    Affair getAffairByIdAndBigType(Integer id, Integer bigType);

    void deleteAffairByIdAndBigType(Integer id, Integer bigType);

    @Insert("insert into club_affairs(affair_type,initiator_id,reason,club_id,value1,value2,value3,value4,value5,value6) " +
            "values(#{affairType},#{initiatorId},#{reason},#{clubId},#{value1},#{value2},#{value3},#{value4},#{value5},#{value6})")
    void addClubAffair(Affair affair);

    List<AffairFont> getClubFontAffairByTypeAndClubId(Integer type, List<Integer> clubIds);
}
